package com.hjx.windowtool;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.util.Random;
import java.awt.event.ActionEvent;

public class RollTestApp {

	private JFrame frame;
	private JTextField txt_start;
	private JTextField txt_end;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		for (int i = 0; i < 100; ) {
			int nextInt = new Random().nextInt(100);
			if (nextInt>95) {
				System.out.println(nextInt);
			}
			
		}
//		EventQueue.invokeLater(new Runnable() {
//			public void run() {
//				try {
//					RollTestApp window = new RollTestApp();
//					window.frame.setVisible(true);
//				} catch (Exception e) {
//					e.printStackTrace();
//				}
//			}
//		});
	}

	/**
	 * Create the application.
	 */
	public RollTestApp() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 640, 442);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JPanel panel = new JPanel();
		frame.getContentPane().add(panel, BorderLayout.NORTH);
		
		txt_start = new JTextField();
		txt_start.setText("1");
		panel.add(txt_start);
		txt_start.setColumns(10);
		
		JLabel label = new JLabel("-");
		panel.add(label);
		
		txt_end = new JTextField();
		txt_end.setText("100");
		panel.add(txt_end);
		txt_end.setColumns(10);
		
		JButton btnTest = new JButton("test");
		btnTest.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
			}
		});
		panel.add(btnTest);
		
		JScrollPane scrollPane = new JScrollPane();
		frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
		
		JTextArea textArea = new JTextArea();
		scrollPane.setViewportView(textArea);
	}

}
